package com.example.zqm.git72.Model;

import com.example.zqm.git72.JavaBean.Activity;
import com.example.zqm.git72.Service.ActivityService;
import com.example.zqm.git72.Service.ClubService;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by Administrator on 2017/4/26.
 */

public class ActivityModel {
    private Retrofit retrofit;
    public ActivityModel(){

        //联网获取网络上的数据
         retrofit = new Retrofit.Builder()
                .baseUrl("http://172.24.10.175/")
                .addConverterFactory(GsonConverterFactory.create())
                .build();

    }

    public Call getList()
    {
        ActivityService activityService=retrofit.create(ActivityService.class);
        return activityService.getList();
    }
  public  Call getActivityById(String id)
{
    ActivityService activityService=retrofit.create(ActivityService.class);
    return activityService.getActivityById(id);
}
    public Call bysearch(String name){
        ActivityService activityService=retrofit.create(ActivityService.class);
        return activityService.bysearch(name);
    }
    public Call signActivity(String participantname,String act_id,String participanttel,String pay,String insurance,String userid)
    {
        ActivityService activityService =retrofit.create(ActivityService.class);
        return activityService.signActivity(participantname,act_id,participanttel,pay,insurance,userid);
}
    public Call sign(String user_id)
    {
        ActivityService activityService =retrofit.create(ActivityService.class);
        return activityService.sign(user_id);
    }
}
